<template>
  <div class="container">
    <div class="classify_open">
      <div class="classify_left">
        <ul class="classify_left_man">
          <li
            v-for="(item, index) in Object.keys(woman_goods)"
            :key="item"
            @click="changeIssue(index)"
          >
            {{ item }}
          </li>
        </ul>
      </div>
      <div class="classify_middle">
        <ul class="classify_left_man">
          <li
            v-for="item in Object.values(woman_goods)[currentIndex]"
            :key="item"
            @click="toTitle(item)"
          >
            {{ item }}
          </li>
        </ul>
      </div>
      <div class="classify_right">
        <img :src="images[currentIndex]" alt="" />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "ProductManIssue",
  data() {
    return {
      woman_goods: {
        外套: ["西装", "风衣", "羽绒"],
        裤装: ["高腰", "牛仔", "绒面"],
        裙装: ["连衣裙", "碎花", "半身"],
        "衬衫&T恤": ["长袖", "开领", "T恤"],
      },
      currentIndex: 0,
      images: [
        "https://www.louisvuitton.cn/images/is/image/lv/1/P…%A8%81%E7%99%BB--W_FW21_RTW_July_DI2.jpg?wid=1080",
        "https://www.louisvuitton.cn/images/is/image/lv/1/P…%BB--Women_MM_Cruise22_Collection_DI2.jpg?wid=824",
        "https://www.louisvuitton.cn/images/is/image/lv/1/P…E7%99%BB--M45890_CVD_Fall_in_Love_DI2.jpg?wid=824",
        "	https://www.louisvuitton.cn/images/is/image/lv/1/P…E7%99%BB--M58739_CVD_Fall_in_Love_DI2.jpg?wid=824",
      ],
    };
  },
  methods: {
    changeIssue(index) {
      this.currentIndex = index;
    },
    toTitle(item) {
      let keyword = item;
      this.$axios
        .get(
          `/api/product/getProductByMoreKeywords?k1=${keyword}&k2=女&k3=&k4=`
        )
        .then((res) => {
          this.product = res.data.results;
          this.$router.push({
            name: "ProductIssueShow",
            params: { id: this.product },
          });
        })
    },
  },
};
</script>
<style scoped>
* {
  margin: 0;
  padding: 0;
}
.container {
  width: 1170px;
  margin: 0 auto;
}
.classify_open {
  width: 100%;
  height: 600px;
  border: 1px solid #ccc;
  display: flex;
  border-radius: 5px;
}

.classify_left {
  flex: 1;
  width: 100%;
  background-color: #fff;
}

.classify_middle {
  flex: 1;
  width: 100%;
  background-color: #f6f5f3;
}

.classify_right {
  flex: 2;
  width: 100%;
  background-color: #f6f5f3;
  overflow: hidden;
}

.classify_right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s;
}

.classify_right img:hover {
  transform: scale(1.1);
}

.classify_middle .classify_left_man {
  margin-top: 80px;
}

.classify_left_man {
  list-style: none;
  display: block;
  width: 120px;
  margin: 50px auto;
}

.classify_left_man li {
  height: 50px;
  text-align: center;
  line-height: 50px;
}

.classify_left_man li:hover {
  cursor: pointer;
}

.classify_left_man li::after {
  content: "";
  display: block;
  transition: all 300ms ease-in-out 0s;
  cursor: pointer;
  border-top: 1px solid #000;
  width: 0;
}

.classify_left_man li:hover::after {
  width: 100%;
}
</style>